package com.sean.dao;

import com.sean.pojo.User;
import org.apache.ibatis.annotations.*;

import java.util.List;
import java.util.Map;

public interface UserMapper {

    @Select("select * from user")
    List<User> getUsers();

    @Select("select * from user where id=#{id} and name=#{name}")
    User getUserByIdAndName(@Param("id") int id, @Param("name") String name);

    @Insert("insert into user (id, name, pwd) values (#{id}, #{name}, #{password})")
    int insert(User user);

    @Update("update user set name=#{name}, pwd=#{password} where id=#{id}")
    int update(User user);

    @Delete("delete from user where id=#{id}")
    int delete(@Param("id") int id);
}
